package com.yangcsoft.modules.deptmanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yangcsoft.common.utils.PageUtils;
import com.yangcsoft.common.utils.Query;

import com.yangcsoft.modules.deptmanage.dao.ContractPayItemDao;
import com.yangcsoft.modules.deptmanage.entity.ContractPayItemEntity;
import com.yangcsoft.modules.deptmanage.service.ContractPayItemService;


@Service("contractPayItemService")
public class ContractPayItemServiceImpl extends ServiceImpl<ContractPayItemDao, ContractPayItemEntity> implements ContractPayItemService {
    @Autowired
    private ContractPayItemDao dao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String key = params.get("key").toString();
        Page<ContractPayItemEntity> page = this.selectPage(
                new Query<ContractPayItemEntity>(params).getPage(),
                new EntityWrapper<ContractPayItemEntity>()
                                             .like("pay_item_no",key)
                 .or()
                                                             .like("pay_item_money",key)
                 .or()
                                                             .like("pay_item_status",key)
                 .or()
                                                            .like("contract_no",key)
                                    );

        return new PageUtils(page);
    }

    @Override
    public void save(ContractPayItemEntity entity) {
        dao.save(entity);
    }


}
